library(prophet)
Loading required package: Rcpp
str(pg.table)
'data.frame': 3784 obs. of 7 variables:
$ Market : chr "ABOHAR(PB)" "ABOHAR(PB)" "ABOHAR(PB)" "ABOHAR(PB)" ...
$ Month Name : chr "January" "January" "January" "February" ...
$ Year : chr "2014" "2015" "2017" "2014" ...
$ Arrival (q) : int 440 1305 200 1115 1115 1300 920 670 1350 940 ...
$ Price Minimum (Rs/q): chr "1025" "1309" "750" "831" ...
$ Price Maximum (Rs/q): chr "1481" "1858" "1000" "1163" ...
$ Modal Price (Rs/q) : chr "1256" "1613" "850" "983" ...
dim(df)
[1] 3783 7
str(df)
'data.frame': 3783 obs. of 7 variables:
$ market : chr "ABOHAR(PB)" "ABOHAR(PB)" "ABOHAR(PB)" "ABOHAR(PB)" ...
$ month : chr "January" "January" "January" "February" ...
$ year : num 2014 2015 2017 2014 2015 ...
$ quantity: num 440 1305 200 1115 1115 ...
$ priceMin: num 1025 1309 750 831 1200 ...
$ priceMax: num 1481 1858 1000 1163 1946 ...
$ priceMod: num 1256 1613 850 983 1688 ...
str(df)
'data.frame': 3783 obs. of 10 variables:
$ market : chr "ABOHAR(PB)" "ABOHAR(PB)" "ABOHAR(PB)" "ABOHAR(PB)" ...
$ month : chr "January" "January" "January" "February" ...
$ year : num 2014 2015 2017 2014 2015 ...
$ quantity: num 440 1305 200 1115 1115 ...
$ priceMin: num 1025 1309 750 831 1200 ...
$ priceMax: num 1481 1858 1000 1163 1946 ...
$ priceMod: num 1256 1613 850 983 1688 ...
$ city : chr "ABOHAR" "ABOHAR" "ABOHAR" "ABOHAR" ...
$ state : chr "PB" "PB" "PB" "PB" ...
$ date : Date, format: "2014-01-01" "2015-01-01" "2017-01-01" "2014-02-01" ...
Split-Apply-Combine
ggplotly(g)
We recommend that you use the dev version of ggplot2 with `ggplotly()`
Install it with: `devtools::install_github('hadley/ggplot2')`
dfBang <- df %>%
filter(city == "BANGALORE") %>%
select(date, priceMod) %>%
arrange(date)
ggplot(dfBang) + aes(date, priceMod) + geom_line()
prophet_plot_components(m, forecast)
uniqcity <- unique(dfCity$city)
geo <- geocode(uniqcity)
Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=BANGALORE&sensor=false
Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=DELHI&sensor=false
Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=LASALGAON&sensor=false
Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=MAHUVA&sensor=false
Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=MUMBAI&sensor=false
Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=NEWASA&sensor=false
Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=PIMPALGAON&sensor=false
Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=PUNE&sensor=false
Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=SOLAPUR&sensor=false
dfGeo <- bind_cols(df2016City, geo)
dfGeo
ggplot(dfGeo) + aes(lon, lat, size=quantity_year/1000) + geom_point() + coord_map()
map <- get_map("India", zoom = 5)
Map from URL : http://maps.googleapis.com/maps/api/staticmap?center=India&zoom=5&size=640x640&scale=2&maptype=terrain&language=en-EN&sensor=false
Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=India&sensor=false
ggmap(map)
map1 <- get_map("India", maptype = "watercolor", source = "stamen", zoom = 5)
Map from URL : http://maps.googleapis.com/maps/api/staticmap?center=India&zoom=5&size=640x640&scale=2&maptype=terrain&sensor=false
Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=India&sensor=false
Map from URL : http://tile.stamen.com/watercolor/5/21/12.jpg
Map from URL : http://tile.stamen.com/watercolor/5/22/12.jpg
Map from URL : http://tile.stamen.com/watercolor/5/23/12.jpg
Map from URL : http://tile.stamen.com/watercolor/5/24/12.jpg
Map from URL : http://tile.stamen.com/watercolor/5/21/13.jpg
Map from URL : http://tile.stamen.com/watercolor/5/22/13.jpg
Map from URL : http://tile.stamen.com/watercolor/5/23/13.jpg
Map from URL : http://tile.stamen.com/watercolor/5/24/13.jpg
Map from URL : http://tile.stamen.com/watercolor/5/21/14.jpg
Map from URL : http://tile.stamen.com/watercolor/5/22/14.jpg
Map from URL : http://tile.stamen.com/watercolor/5/23/14.jpg
Map from URL : http://tile.stamen.com/watercolor/5/24/14.jpg
Map from URL : http://tile.stamen.com/watercolor/5/21/15.jpg
Map from URL : http://tile.stamen.com/watercolor/5/22/15.jpg
Map from URL : http://tile.stamen.com/watercolor/5/23/15.jpg
Map from URL : http://tile.stamen.com/watercolor/5/24/15.jpg
ggmap(map1)
ggmap(map1) + geom_point(data = dfGeo,aes(lon,lat,size=quantity_year/1000,color=city))